<?php
    function get_url($gm_url = 'home'){
		switch ($gm_url){
			default:
			case 'home':
				echo GM_HOME;
				break;
			case 'login':
				echo GM_HOME."gm_login.php";
		}
		return;
	}
	function check_user($id){
		$db=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD);
		mysql_select_db(DB_NAME);
		$result=mysql_query("SELECT * FROM `user` where name='$name' and password='$pass'",$db);
		if ($myrow = mysql_fetch_row($result)) {
			session_start();
			session_register("user");
			$user=$myrow["user"];
		}
		else {
			echo"身份验证失败，您无权共享网络资源!";
		}
	}
?>